//
//  RedController.swift
//  CustomPresent
//
//  Created by dyoung on 2022/2/8.
//

import UIKit

class PageBController: UIViewController {

    var isDoublePush: Bool = false
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let b = UIButton()
        b.backgroundColor = .red
        view.addSubview(b)
        b.addTarget(self, action: #selector(clicked), for: .touchUpInside)
        b.snp.makeConstraints { m in
            m.center.equalToSuperview()
            m.height.width.equalTo(100)
        }
    }
    
    @objc func clicked() {
        if let navi = self.navigationController {
            let vc = isDoublePush ? BlueController() : PageCController()
            navi.pushViewController(vc, animated: true)
        } else {
            UIViewController.current?.navigationController?.pushViewController(PageCController(), animated: true)
        }
    }

}
